"""
example02 - 字符串索引和切片

跑马灯文字效果

OS ---> Operating System ---> 操作系统 ---> macOS / iOS / tvOS

清除屏幕输出：Windows ---> cls / macOS ---> clear

Author: Administrator
Date: 2024/1/11
"""
import os
import time

content = '          拼搏到无能为力，坚持到感动自己          '
while True:
    # os.system('clear')
    os.system('cls')
    print(content)
    # 休眠 - 让程序暂停300ms
    time.sleep(0.3)
    content = content[1:] + content[0]

# content = '         拼搏到无能为力，坚持到感动自己           '
# content = '        拼搏到无能为力，坚持到感动自己            '
# content = '       拼搏到无能为力，坚持到感动自己             '
# content = '      拼搏到无能为力，坚持到感动自己              '

# a = 'hello,world'
# print(a[0], a[-len(a)])
# print(a[len(a)-1], a[-1])
# print(a[5], a[-7])
#
# print(a[2:5])
# print(a[1:10:2])
# print(a[::-1])